package com.goktech.olala.core.service;

import com.goktech.olala.core.req.ReqCtmInfo;
import com.goktech.olala.core.req.ReqCtmLevel;
import com.goktech.olala.core.req.ReqCtmLogin;
import com.goktech.olala.core.resp.RespConsigneeVo;
import com.goktech.olala.core.resp.RespCtmLogin;
import com.goktech.olala.core.resp.RespCtmInfo;
import com.goktech.olala.server.pojo.customer.*;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @author wyn
 */
public interface ICtmInfoService {
    /**
     * 保存
     * @param record
     * @return
     * @throws Exception
     */
    int saveCtmLogin(CtmLogin record) throws Exception;

    /**
     * 查询会员信息
     * @param customerInfId
     * @param customerId
     * @return
     * @throws Exception
     */
    RespCtmInfo queryCustomerInfoById(String customerInfId, String customerId) throws Exception;

    /**
     * 查询会员随机id查询信息
     * @param customerId
     * @return
     * @throws Exception
     */
    CtmInfo queryCustomerIdById(String customerId) throws Exception;

    /**
     * 根据登录名查询用户信息
     * @param customerLoginName
     * @return
     * @throws Exception
     */
    CtmLogin findInfoByLoginName(String customerLoginName) throws Exception;

    /**
     * 查询会员等级信息
     * @param customerLevelId
     * @return
     * @throws Exception
     */
    CtmLevelInfo queryCtmlevelById(Integer customerLevelId) throws Exception;

    /**
     * 登陆验证
     * @param userName
     * @param pwd
     * @return
     * @throws Exception
     */
    RespCtmLogin queryCmtInfoForLogin(String userName, String pwd) throws Exception;

    /**
     * 查询客户信息
     * @param pageIndex
     * @param pageSize
     * @param reqCtmInfo
     * @return
     * @throws Exception
     */
    PageInfo<RespCtmInfo> queryCmtInfoByExample(int pageIndex, int pageSize, ReqCtmInfo reqCtmInfo) throws Exception;

    /**
     * 保存客户信息
     * @param reqCtmInfo
     * @return
     * @throws Exception
     */
    RespCtmLogin saveCmtInfo(ReqCtmInfo reqCtmInfo) throws Exception;

    /**
     * 保存登录日志信息
     *
     * @param reqCtmLogin
     * @return
     * @throws Exception
     */
    int saveLoginLog(ReqCtmLogin reqCtmLogin) throws Exception;

    /**
     * 添加会员等级
     * @param reqCtmLevel
     * @return
     * @throws Exception
     */
    int saveCmtLevelInfo(ReqCtmLevel reqCtmLevel) throws Exception;

    /**
     * 删除客户信息
     * @param customerInfId
     * @return
     * @throws Exception
     */
    int removeCmtInfoById(String customerInfId) throws Exception;

    /**
     * 批量删除客户信息
     * @param customerInfIds
     * @return
     * @throws Exception
     */
    int removeCmtInfoByIdBatch(String[] customerInfIds) throws Exception;

    /**
     * 更新
     * @param customerInfId
     * @param isDel
     * @return
     * @throws Exception
     */
    int updateDelStatusById(String customerInfId, Integer isDel) throws Exception;

    /**
     * 更新
     * @param customerInfIds
     * @param isDel
     * @return
     * @throws Exception
     */
    int updateDelStatusByIdBatch(String[] customerInfIds, Integer isDel) throws Exception;

    /**
     * 校验用户
     * @param mobile
     * @param email
     * @return
     * @throws Exception
     */
    RespCtmInfo checkUser(String mobile, String email) throws Exception;

    /**
     * 删除会员等级
     * @param ctmLevelInfo
     * @return
     * @throws Exception
     */
    int removeLevelById(Integer ctmLevelInfo) throws Exception;

    /**
     * 删除登陆日志
     * @param loginId
     * @return
     * @throws Exception
     */
    int removeLoginlogById(Long loginId) throws Exception;

    /**
     * 添加用户信息
     * @param ctmInfo
     * @return
     * @throws Exception
     */
    int insertCtmInfo(CtmInfo ctmInfo) throws Exception;

    /**
     * 修改会员的状态
     * @param customerId
     * @param status
     * @return
     * @throws Exception
     */
    int updateCmtStatus(String customerId, Integer status) throws Exception;

    /**
     * 修改登录密码
     * @param customerId
     * @param newPassword
     * @return
     * @throws Exception
     */
    int updateCmtPwd(String customerId, String newPassword) throws Exception;

    /**
     * 修改个人信息页会员信息
     * @param record
     * @return
     * @throws Exception
     */
    int updateCustomerInfoByCtmId(CtmInfo record) throws Exception;

    /**
     * 查询会员地址表信息
     * @param customerId
     * @return
     * @throws Exception
     */
    List<RespConsigneeVo> queryCustomerConsignee(String customerId) throws Exception;

    /**
     * 根据地址编号查询地址信息
     * @param addressId
     * @return
     * @throws Exception
     */
    List<CtmConsignee> queryConsigneeByAddressId(Integer addressId) throws Exception;

    /**
     * 新增收货人地址
     * @param record
     * @return
     * @throws Exception
     */
    int addConsignee(CtmConsignee record) throws Exception;

    /**
     * 删除
     * @param record
     * @return
     * @throws Exception
     */
    int delConsignee(Integer record) throws Exception;

    /**
     * 我的资产：根据用户id查询积分信息
     * @param customerId
     * @return
     * @throws Exception
     */
    List<CtmPointLog> queryCustomerPoints(String customerId) throws Exception;

    /**
     * 我的资产：根据用户id查询可用积分
     * @param customerId
     * @return
     * @throws Exception
     */
    String queryCustomerPointsUsable(String customerId) throws Exception;

    /**
     * 我的资产：查询账户余额
     * @param customerId
     * @return
     * @throws Exception
     */
    List<CtmBalance> queryBalance(String customerId) throws Exception;

    /**
     * 查询会员等级
     * @param pageIndex
     * @param pageSize
     * @param reqCtmLevel
     * @return
     * @throws Exception
     */
    PageInfo<CtmLevelInfo> queryCtmLevel(int pageIndex, int pageSize, ReqCtmLevel reqCtmLevel) throws Exception;

    /**
     * 查询会员登陆日志
     * @param pageIndex
     * @param pageSize
     * @param reqCtmLogin
     * @return
     * @throws Exception
     */
    PageInfo<RespCtmLogin> queryCtmLoginLog(int pageIndex, int pageSize, ReqCtmLogin reqCtmLogin) throws Exception;

    /**
     * 通过id查询用户签到信息
     * @param ctmSingLog
     * @return
     * @throws Exception
     */
    String querySignById(String ctmSingLog) throws Exception;

    /**
     * 插入用户签到信息
     * @param ctmSignLog
     * @return
     * @throws Exception
     */
    int insertSignInfo(CtmSingLog ctmSignLog) throws Exception;

    /**
     * 根据id查询签到时间
     * @param customerId
     * @return
     * @throws Exception
     */
    CtmSingLog selectTimeById(String customerId) throws Exception;

    /**
     * 更新签到
     * @param ctmSignLog
     * @return
     * @throws Exception
     */
    int updateSignInfo(CtmSingLog ctmSignLog) throws Exception;

    /**
     * 通过id查询登陆用户所有信息
     * @param customerId
     * @return
     * @throws Exception
     */
    CtmSingLog querySignInfoById(String customerId) throws Exception;

    /**
     * 新增
     * @param record
     * @return
     * @throws Exception
     */
    int insertPoint(CtmPointLog record) throws Exception;


}
